find the second largest element in an array in javascript